Image Processing Device, Image Processing Method, Scanner and Storage Medium

ABSTRACT

The disclosure provides an image processing device, image processing method, scanner and storage medium. The image processing device is used for tracing a boundary of an object image in an image, the boundary being continuous and the rate of change in slope between adjacent points on the boundary being slow. The image processing device includes: a boundary estimation unit, adapted to estimate the location of the boundary of the object image; an interfering gradient processing unit, adapted to process an interfering gradient near the estimated boundary, so as to reduce the interfering gradient or remove the interfering gradient from the image; and a boundary tracing unit, adapted to trace the boundary in the image having the interfering gradient processed. By using the technique of the disclosure, the accuracy of tracing a boundary of an image is improved significantly.

CROSS REFERENCE TO RELATED APPLICATION

This application relates to the subject matter of the Chinese patentapplication for invention, Application No. 201210177619.0, filed withChina's State Intellectual Property Office on May 31, 2012. Thedisclosure of this Chinese application is considered part of and isincorporated by reference in the disclosure of this application.

FIELD OF THE INVENTION

The disclosure relates to a field of image processing, and particularlyto an image processing device, image processing method, scanner andstorage medium for tracing a boundary.

BACKGROUND OF THE INVENTION

Distortion usually occurs to an image obtained by performing an imageobtaining operation, such as photographing or scanning, on astereoscopic object. Take a document scanning as an example, distortion,such as perspective transformation and tensile deformation, exists in ascanned image regardless of a traditional flat panel scanner or anadvanced curved surface scanner. In addition, take a product logoidentification application for an example, there is distortion in animage obtained by photographing a logo on a product such as a beveragebottle, and thus accuracy of identification is affected.

Therefore, to remove distortion, enrich document edition, and improveaccuracy of content identification, it is important to obtain anaccurate boundary of an image of a document or a logo. In this context,various boundary tracing technologies, for example a dynamic planningtechnology, have been researched and used widely.

SUMMARY OF THE INVENTION

However, when a traditional boundary tracing technology such as thedynamic planning is used, boundary extraction will be interfered bygradient information of content in an object image to be traced orsurrounding environment of an object image to be traced, and thusaccuracy of boundary tracing is affected. Content in an object image maybe for example contents such as patterns and characters in a documentimage or a logo image, etc. The surrounding environment of an objectimage may be for example background textures of a table on which adocument is placed, or patterns of a commodity to which a log image isattached. Specifically, when a gradient of the content or of thebackground environment around the boundary is relatively intense, lines,etc., in the content or in the background environment may be regarded asa boundary in error by a conventional boundary tracing technology, andan error tracing is caused.

In view of the above problem, the disclosure provides an imageprocessing device, image processing method, scanner and storage mediumwhich remove affection of gradient of the content or the background ofan object image by using global information of a boundary. It aims toestimate preliminarily a location of a boundary prior to the use of thetraditional boundary tracing technology, and then to reduce or removecontent and/or background gradient near the estimated boundary locationto thereby avoid affection on subsequent boundary tracing processes. Thetechnique according to the disclosure is particularly applicable for acase where a boundary of an object image is continuous and a rate ofchange in slope between adjacent points on the boundary is slow.

According to an embodiment of the invention, there is provided an imageprocessing device for tracing a boundary of an object image in an image,the boundary being continuous and a rate of change in slope betweenadjacent points on the boundary being slow, the image processing devicecomprising: a boundary estimation unit adapted to estimate a location ofa boundary of an object image; an interfering gradient processing unitadapted to process an interfering gradient near an estimated boundary,so as to reduce the interfering gradient or remove the interferinggradient from the image; and a boundary tracing unit adapted to trace aboundary in the image having the interfering gradient processed.

In an embodiment, the boundary estimation unit comprises: a segmentationunit adapted to segment a portion of the image between two corners onthe boundary into a predetermined number of segments; and a segmentboundary estimation unit, adapted to estimate a location of a boundaryrespectively in each of the segments.

In an embodiment, the segment boundary estimation unit comprises aboundary approximation unit for approximating the boundary in each ofthe segments using a straight line segment, the boundary approximationunit is adapted to, for at least one of outermost segments where thecorners are in respectively, set the corner in the outermost segment asa start point of a first straight line segment used to approximate theboundary in the outermost segment, and select an end point for the firststraight line segment on a first segmentation line resulting in theoutermost segment, so that in a gradient histogram of a narrow bandcovering the first straight line segment, pixels exhibit the greatestdegree of concentration with respect to the greatest gradient; and theboundary approximation unit is further adapted to set the obtained endpoint of the boundary-approximating straight line segment as a startpoint of a second straight line segment used to approximate the boundaryin a next, adjacent segment, and select an end point for the secondstraight line segment on a second segmentation line which results in thenext segment and is not common to the next segment and the segment forwhich the boundary-approximating straight line segment has beenobtained, so that in a gradient histogram of a narrow band covering thesecond straight line segment, pixels exhibit the greatest degree ofconcentration with respect to the greatest gradient.

In an embodiment, the segment boundary estimation unit further comprisesan evaluation unit adapted to evaluate usability of an approximatingstraight line segment obtained by the boundary approximation unit.

In an embodiment, the evaluation unit comprises: a concentration degreeevaluation unit, adapted to determine whether a degree at which thepixels concentrate on the greatest gradient is larger than or equal to apredetermined degree, and if it is larger than or equal to thepredetermined degree, the concentration degree evaluation unitdetermines that the approximating straight line segment of the boundaryis available; otherwise, the concentration degree evaluation unitdetermines the approximating straight line segment of the boundary isunavailable.

In an embodiment, the evaluation unit comprises an inclination angleevaluation unit, adapted to compare an inclination angle of anewly-obtained approximating straight line segment with an inclinationangle of an approximating straight line segment in a previous, adjacentsegment, and if the difference between the inclination angles is smallerthan or equal to a predetermined threshold, the inclination angleevaluation unit determines the approximating straight line segment isavailable; otherwise, the inclination angle evaluation unit determinesthe approximating straight line segment is unavailable.

In an embodiment, the interfering gradient processing unit is adapted toprocess gradient near the approximating straight line segment for eachof the segments.

In an embodiment, the interfering gradient processing unit is adapted toprocess gradient in a predetermined region except for a narrow bandincluding the approximating straight line segment.

In an embodiment, when an approximating straight line segment in theoutermost segment is unavailable, the interfering gradient processingunit is adapted to process gradients except for the narrow band having apredetermined width above or under a horizontal line where corners arein; and the boundary tracing unit is adapted to trace a boundary of anobject image for the image subjected to the process.

In an embodiment, when approximating is only started from a corner atone end, and an approximating straight line segment of a certain segmentis unavailable, the interfering gradient processing unit is adapted toconnect an end point of an approximating straight line segment of thelast segment for which the approximating is available to a corner at theother end, and to process the gradient of the connecting line at theside where the boundary does not exist.

In an embodiment, when approximating is started simultaneously fromcorners at both ends, and an approximation of a segment at a certainside or at both sides is unavailable, the interfering gradientprocessing unit is adapted to connect an end point of an approximatingstraight line segment of the last segment for which the approximating isavailable to an end point of an approximating straight line segment ofthe last segment for which the approximating is available at the otherside, and to process the gradient of the connecting line at the sidewhere the boundary does not exist.

In an embodiment, the object image described in the above embodiments isa document image.

According to an embodiment of the invention, there is provided a scannercomprising an image processing device according to any one of theembodiments.

According to an embodiment of the invention, there is provided an imageprocessing method, for tracing a boundary of an object image in animage, the boundary being continuous and a rate of change in slopebetween adjacent points on the boundary being slow, the image processingmethod comprising: a boundary estimation step of estimating a locationof a boundary of an object image; an interfering gradient processingstep of processing an interfering gradient near the estimated boundary,so as to reduce the interfering gradient or remove the interferinggradient from the image; and a boundary tracing step of tracing aboundary in the image having the interfering gradient processed.

According to an embodiment of the invention, there is provided acomputer readable storage medium storing with computer program causing acomputer to execute a process of tracing a boundary of an object imagein an image, the bounding being continuous, and the rate of change inslope between adjacent points being slow, the processing comprising:estimating a location of a boundary of an object image; processing aninterfering gradient near the estimated boundary to reduce theinterfering gradient or remove the interfering gradient from the image;and tracing the boundary in the image having the interfering gradientprocessed.

By using the image processing device, image processing method, scannerand computer readable storage medium according to the invention, apre-process may be performed to an image before a traditional boundarytracing process is performed, specifically, by estimating preliminary alocation of a boundary, content and/or background gradient near theestimated location may be reduced or removed to reduce a possibility oferroneous tracing of a boundary, and improve accuracy of tracing aboundary. Thus, it is helpful to enrich document edition and improveaccuracy of identifying a logo.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other objects, features and advantages of the inventionmay be understood more easily by referring to description of theembodiments of the invention provided in conjunction with the Drawings,in which the same or corresponding technical feature or component isrepresented by the same or corresponding reference sign, and in whichthe size and the relative position of the unit are not necessarily drawnin ratio.

FIG. 1 is a schematic view showing an image obtained by scanning adocument by a scanner.

FIG. 2 is a function block diagram showing a boundary tracing unitaccording to an embodiment of the invention.

FIG. 3 is a function block diagram showing a boundary tracing unitaccording to an embodiment of the invention.

FIG. 4 is a schematic view illustratively showing segmenting a lowerboundary at a side of a document binding line in the document imageshown in FIG. 1.

FIG. 5 is an explanatory view illustratively showing a boundaryapproximating process performed by a boundary approximating unitaccording to an embodiment of the invention.

FIG. 6 is an explanatory view illustratively showing an inclination ofan approximating straight line segment of a boundary of two adjacentsegments.

FIG. 7 is a block diagram illustratively showing a function structure ofan example of a segment boundary estimation unit according to anembodiment of the invention.

FIG. 8 is an explanatory view illustratively showing an example of afirst case of interfering gradient processing according to an embodimentof the invention.

FIG. 9 is an explanatory view illustratively showing an example of asecond case of interfering gradient processing according to anembodiment of the invention.

FIG. 10 is an explanatory view illustratively showing an example of athird case of interfering gradient processing according to an embodimentof the invention.

FIG. 11 is a flowchart showing a processing procedure of the boundarytracing method according to an embodiment of the invention.

FIG. 12 is a flowchart illustratively showing an example of a documentboundary tracing process performed on the document image, for example,shown in FIG. 1.

FIG. 13 is a block diagram showing an example structure of a computerimplementing the invention.

DETAILED DESCRIPTION OF THE INVENTION

Embodiments of the invention will be described below by referring to theDrawings. It shall be noted that denotation and description of acomponent and a process which are not related to the invention or whichare well know to those skilled in the art are omitted in the descriptionand drawings for the sake of clearness.

To facilitate description, a document image obtained by scanning istaken as an example hereinafter for describing the image processingdevice and the image processing method according to an embodiment of theinvention.

FIG. 1 is a schematic view showing an image obtained by scanning adocument by a scanner. Wherein, contents in the document are omitted,and “∘” is used to indicate a corner of a document image. As can be seenfrom FIG. 1, a distortion occurs to upper and lower boundaries of thedocument image. To facilitate to further edit the document image, thereis a need of tracing upper and lower boundaries accurately. FIG. 2 is afunction block diagram showing a boundary tracing device 200 accordingto an embodiment of the invention.

As shown in FIG. 2, a boundary tracing device 200 comprises: a boundaryestimation unit 201 adapted to estimate a location of a boundary of anobject image, an interfering gradient processing unit 202 adapted toprocess an interfering gradient near the estimated boundary so as toreduce the interfering gradient or remove the interfering gradient fromthe image, and a boundary tracing unit 203 adapted to trace a boundaryin the image having the interfering gradient processed. Hereinafter,description will be given by taking a document image as an example of anobject image, and it shall be understood that the technique of thedisclosure may be applied to any other object images which need aboundary tracing, such as a product logo image, as long as the boundaryto be traced is continuous and a rate of change in slope betweenadjacent points on the boundary is slow.

The boundary estimation unit 201 estimates a location of a boundary ofan object image obtained by image obtaining operations such as scanning.Specifically, for the document image shown in FIG. 1, the boundaryestimation unit 201 may estimate locations of upper and lower boundariesof the document image. Here, the boundary estimation unit 201 performs afunction of locating preliminary a boundary to obtain approximatelocations of boundaries of the document to facilitate subsequentgradient processing operations. The boundary estimation unit 201 mayestimate the location of the boundary of the document by using variousmethods well known in the art. For example, a preliminary boundarydetecting technique such as Sobel operator may be used. A location of aboundary may be even marked manually in the document image.

After obtaining the location of the estimated boundary, the interferinggradient processing unit 202 may selectively process an interferinggradient around the location. For example, reduce or remove aninterfering gradient from an image. For instance, when the boundaryestimation unit 201 estimates the location of the lower boundary of thedocument image shown in FIG. 1, the interfering gradient processing unit202 may reduce or remove gradient of each of pixels in an adjacentregion above the lower boundary.

First of all, it needs to be noted that as can be appreciated by thoseskilled in the art, various processes performed on an image inembodiments listed by the disclosure are carried out on a gradient mapof a curved area of a boundary of an entire image or an object image. Inthe disclosure, to show the attached drawings much clearly, a reversegradient map with while background and black gradient is used in each ofthe examples of Figures (FIGS. 4-6, and FIGS. 8-10). In an inversegradient map, an inverse gradient value=255-orignal gradient value. Forexample, in a normal gradient map, a gradient value of a greatestgradient is 255, and a gradient value of a minimum gradient is 0. Then,in an inverse gradient map, a gradient value of a greatest gradient is0, and a gradient value of a minimum gradient is 255.

In an embodiment using such a reverse gradient map, the interferinggradient processing unit 202 may set a gradient value in a region (aregion to be processed) around a location of a boundary to be 255(equivalent to removing a gradient), or may increase a gradient value ina region to be processed by a predetermined rule (equivalent to reducinga gradient). For example, when a gradient value corresponding to acertain pixel in a region to be processed is 120, the gradient value maybe multiplied by 2 to obtain a gradient value of 240 to reduce agradient. Reducing a gradient, instead of removing a gradient, mayprevent from erroneously removing of a real boundary when the locationof the boundary estimated by the boundary estimation unit 201 isinaccurate. Similarly, when other textures are in a background (such asa scanning table) of a document image, the same process may be performedon an adjacent region below the lower boundary.

Of course, in an embodiment using a normal gradient map (blackbackground), the interfering gradient processing unit 202 may process agradient in a region to be processed. For instance, set all of thegradient values in the region to be processed to be 0. That is, removean interfering gradient. Or, to prevent from erroneously removing of areal boundary when the location of the boundary estimated by theboundary estimation unit 201 is inaccurate, the interfering gradientprocessing unit 202 may decrease a gradient value in the region to beprocessed by a predetermined rule. The predetermined rule for examplemay be a rule of dividing the gradient value by an integer (for example,2, 3) or subtracting from the gradient a fixed number. Thus, gradient inthe region to be processed is reduced. Hereinafter, to display clearly,a case using an inverse gradient map is described illustratively only.

A document image having interfering gradient processed is delivered tothe boundary tracing unit 203. The boundary tracing unit 203 may trace aboundary for the document image having interfering gradient processed byusing various boundary tracing technologies well known in the art suchas a dynamic planning.

Obviously, the accuracy of the location of the estimated boundaryaffects greatly the validity of removing an interfering gradient andthus affects greatly an accuracy of boundary tracing. The embodimentaccording to FIG. 3 aims to improve an accuracy of a location of anestimated boundary. FIG. 3 is a function block diagram showing aboundary tracing device 300 according to an embodiment of the invention.The boundary tracing unit 303 in the boundary tracing device 300 has thesame function and configuration as the boundary tracing unit 203 in theboundary tracing device 200, and the detailed descriptions are omitted.

The boundary tracing device 300 comprises: a boundary estimation unit301, an interfering gradient processing unit 302 and a boundary tracingunit 303. Wherein, the boundary estimation unit 301 comprises asegmentation unit 31 and a segment boundary estimation unit 32. Thesegmentation unit 31 is adapted to segment a portion of the imagebetween two corners on the boundary into a predetermined number ofsegments. The segment boundary estimation unit 32 is adapted to estimatethe location of the boundary respectively in each of the segments.

FIG. 4 is a schematic view showing illustratively segmenting a lowerboundary at a side of a document binding line in the document imageshown in FIG. 1. FIG. 4 further illustratively shows document contentsthat may affect a boundary tracing. In case of two given corners, thesegmentation unit 41 for example may obtain a predetermined number ofsegments on the boundary in a simplest manner: segmenting evenly asegment between two corners using a segmentation line perpendicular to aconnecting line of two corners to segment a boundary curve. In theembodiment shown in FIG. 4, the boundary is segmented into 6 segments.Of course, any other segmentation manner may be selected on the basis ofa design demand. For instance, a boundary may be segmented by using asegment line inclined to a connecting line of two corners or bysegmenting unevenly a connecting line of corners. The number of thesegment segmented is determined upon a distance between corners at bothends of the boundary, required boundary estimation preciseness, etc. Forexample, 5 to 20 segments may be selected. A compromise is made betweenthe system calculation amount and the boundary estimation preciseness.

A corner of a boundary may be determined in different manners. Forexample, a corner of a boundary may be detected automatically by usingvarious corner detecting methods well known in the art. Or, a corner isdetermined by a manual input.

The segment boundary estimation unit 32 may estimate a location of aboundary automatically or inputting-manually using well know methodsaccording to the segmented segments. FIG. 7 is a block diagramillustratively showing a function structure of an example 700 of asegment boundary estimation unit according to an embodiment of theinvention.

In the embodiment shown in FIG. 7, the segment boundary estimation unit700 may comprise: a boundary approximation unit 701 adapted toapproximate the boundary in each of the segments using a straight linesegment, and an evaluation unit 702 adapted to evaluate usability of anapproximating straight line segment obtained by the boundaryapproximation unit 701. Wherein, the evaluation unit 702 may comprise: aconcentration degree evaluation unit 71 and an inclination angleevaluation unit 72. Hereinafter, functions of those units will bedescribed in detail by referring to FIGS. 5 and 6, respectively.

FIG. 5 is an explanatory view illustratively showing a boundaryapproximating process performed by the boundary approximating unit 701according to an embodiment of the invention. As shown in FIG. 5, firstof all, the boundary approximation unit 701 starts to perform a boundaryapproximating process at an outermost segment (that is, a segment wherea corner is in) among all of the segments. According to a characteristicof a boundary of an object image and a demand for designing, a boundaryapproximating may be selected to be performed simultaneously from twooutermost segments, or a boundary approximating is performed only fromone outermost segment. In the embodiment shown in FIG. 5, consideringthe fact that distortion occurs badly to a boundary near the bindingline of the document, a boundary approximating is only performed fromthe outermost segment in which corner A locates and that is away fromthe binding line of the document.

Specifically, the boundary approximation unit 701 sets the corner A inthe outermost segment as a start point of a straight line segment usedto approximate the boundary in the outermost segment, and selects an endpoint for the straight line segment on a segmentation line a1 resultingin the outermost segment, so that in a gradient histogram of a narrowband covering the straight line segment, pixels exhibit the greatestdegree of concentration with respect to the greatest gradient. Muchdetailed descriptions are given by referring to formula (1) later.

When an end point of a boundary-approximating straight line segment on asegment line a1 in the outermost segment has been obtained, the boundaryapproximation unit 701 sets the obtained end point as a start point of astraight line segment used to approximate the boundary in a next,adjacent segment. Then, the boundary approximation unit 701 selects anend point for the straight line segment used to approximate on asegmentation line (a2) which results in the next segment and is notcommon to the next segment and the segment for which theboundary-approximating straight line segment has been obtained, so thatin a gradient histogram of a narrow band covering the approximatingstraight line segment, pixels exhibit the greatest degree ofconcentration with respect to the greatest gradient.

By analogy, when an end point of a boundary-approximating straight linesegment of a segment m (m=1 . . . n−1, n is the total number ofsegments) counted from outermost segment on a segment line a_(m) hasbeen obtained, the boundary approximation unit 701 sets the obtained endpoint as a start point of a straight line segment used to approximate aboundary in m+1 segment. Then, the boundary approximation unit 701selects an end point for the straight line segment used to approximateon a segmentation line which results in the segment m+1 and is notcommon to the segment m and the segment m+1, that is, on the segmentline a_(m+1), so that in a gradient histogram of a narrow band coveringthe approximating straight line segment, pixels exhibit the greatestdegree of concentration with respect to the greatest gradient. Theapproximating straight line segments for all segments of the boundarybetween the two corners are thereby obtained.

In other words, a start point is fixed for a boundary-approximatingstraight line segment (including boundary-approximating straight linesegments in segments other than the outermost segment). That is, thestart point is a corner or an end point of an approximating straightline segment of the boundary of the previous segment. However, an endpoint needs to be selected on a segment line different from the segmentline where a corner locates or the end point of the previous segmentobtained by approximating locates. For example, one possible end pointmay be selected every predetermined distance on the segment line, or onepossible end point is selected by going through all of points on thesegment line to form a possible approximating straight line segment withthe start point. Then, a selection of approximating straight linesegment is made in accordance with a principle where in a gradienthistogram of a narrow band covering the possible approximating straightline segment (for example making the approximating straight line segmentas a center line) pixels exhibit the greatest degree of concentrationwith respect to the greatest gradient.

For each possible approximating straight line segment, a gradienthistogram of an adjacent region (for example, a narrow band) iscalculated. As shown in FIG. 5, “

”, is used to indicate a possible approximating straight line segment,and a narrow band is a portion between two “

” segments. For each possible straight line segment, a correspondinggradient histogram may be calculated. For one gradient histogram, theabscissa is the gradient value, and ordinate is the number ofcorresponding pixels.

In the embodiment using an inverse gradient map, a position of thegradient value 0 of a gradient histogram obtained according to theinverse gradient map corresponds to the greatest gradient, and theposition of the gradient value 255 corresponds to the minimum gradient.A most possible approximating straight line segment may be selected byseeking a gradient k of α fractile showing a degree at which the pixelsconcentrate on the greatest gradient in the gradient histogram.

As shown in formula 1), a gradient value k which exceeds α (for example,α=0.95) fractile may be obtained by calculation:

$\begin{matrix}{{argmin}_{k}\left( {{\sum\limits_{i = 0}^{k}h_{i}} \geq {0.95*{\sum\limits_{i = 0}^{255}h_{i}}}} \right)} & (1)\end{matrix}$

and the segment having the minimum k value (gradient is minimum) is themost possible segment, and thus a boundary-approximating straight linesegment of a segment is obtained.

Of course, in another embodiment, a normal gradient map may be used. Ina gradient histogram obtained on the basis of the normal gradient map,the position of the gradient value 255 of the gradient histogramcorresponds to the greatest gradient, and the position of the gradientvalue 0 of the gradient histogram corresponds to the minimum gradient.In such a case, a most possible approximating straight line segment maybe selected by seeking a gradient k showing a degree at which the pixelsconcentrate on the greatest gradient in the gradient histogram throughthe formula (2).

$\begin{matrix}{{argmax}_{k}\left( {{\sum\limits_{i = k}^{255}h_{i}} \geq {0.95*{\sum\limits_{i = 0}^{255}h_{i}}}} \right)} & (2)\end{matrix}$

In case of using a normal gradient map, a segment having the maximum kvalue calculated by formula (2) is the most possible segment, and thus aboundary-approximating straight line segment of a segment is obtained.

The segment boundary estimation unit may include only the boundaryapproximation unit. After an approximating straight line segment of aboundary of a segment is obtained by the boundary approximation unit,the approximating straight line segment is directly delivered to theinterfering gradient processing unit for subsequent interfering gradientprocess.

In addition, to improve accuracy of estimating a boundary, as shown inFIG. 7, the segment boundary estimation unit may further include theevaluation unit 702 adapted to evaluate a usability of the approximatingstraight line segment obtained by the boundary approximation unit 701.Evaluating usability of an approximating straight line segment is todetermine whether the approximating straight line segment approachessufficiently a real boundary, or to determine whether a possibility thatthe approximating straight line segment approaches sufficiently a realboundary is high enough. Evaluation may be performed by using variousdetermination means and standards well known in the art. For example, anevaluation may be made by using a relation between a degree at which thepixels concentrate on the greatest gradient and the predetermined degreeas a standard. Or, for example, an evaluation is made by using adifference between inclination angles of the obtained possibleapproximating straight line segment and the approximating straight linesegment of the previous segment as a rule. When it is determined thatthe approximating straight line segment is available, the approximatingstraight line segment may be used as an location of the estimatedboundary, to reduce or remove an interfering gradient near the positionfrom the image. When it is determined that the approximating straightline segment is unavailable, whether to reduce or remove gradient nearthe approximating straight line segment may be selected according toactual requirements.

In the embodiment of FIG. 7, the evaluation unit 702 for example maycomprise a concentration degree evaluation unit 71 and an inclinationangle evaluation unit 72.

The concentration degree evaluation unit 71 may be used to determinewhether a gradient of the position where the approximating straight linesegment obtained by the boundary approximation unit 701 locates isintense enough. In other words, the concentration degree evaluation unit71 may determine whether a degree at which the pixels concentrate on thegreatest gradient in the above described gradient histogram is largerthan or equal to a predetermined degree.

In case of using an inverse gradient histogram, whether theconcentration of pixels with respect to the greatest gradient is largerthan or equal to a predetermined degree may be evaluated by usinggradient k of α fractile described in formula (1). For example, in anembodiment, when k is smaller than or equal to a threshold Th1, it maybe deemed that the concentration of the pixels with respect to thegreatest gradient is larger than or equal to a predetermined degree;when k is larger than the threshold Th1, it may be deemed that a degreeat which the pixels concentrate on the greatest gradient is smaller thana predetermined degree. The value of Th1 may be for example a valuesmaller than or equal to 245, preferably between 128 and 255. When theconcentration degree is larger than or equal to the predetermineddegree, the concentration degree evaluation unit 72 determines theboundary-approximating straight line segment is available; and when theconcentration degree is smaller than a predetermined degree, theconcentration degree evaluation unit 71 determines theboundary-approximating straight line segment is unavailable.

When the concentration degree evaluation unit 71 determines theboundary-approximating straight line segment is available,alternatively, the inclination angle evaluation unit 72 may be used tofurther validate the usability of the approximating straight linesegment.

The inclination angle evaluation unit 72 may compare an inclinationangle of a newly-obtained approximating straight line segment with aninclination angle of an approximating straight line segment in aprevious, adjacent segment. If the difference between the inclinationangles is smaller than or equal to a predetermined threshold Th2, theinclination angle evaluation unit 72 determines the approximatingstraight line segment is available; if the difference between theinclination angles is larger than a predetermined threshold Th2, theinclination angle evaluation unit 72 determines the approximatingstraight line segment is unavailable. According to a specific condition,Th2 may be a value between 0 degree and 90 degree. For example, Th2 maybe 8 degree.

FIG. 6 is an explanatory view illustratively showing inclinations ofapproximating straight line segments of boundaries of two adjacentsegments. As can be seen intuitionisticly from FIG. 6, when it is giventhat the boundary is continuous and a rate of change in slope betweenadjacent points is slow, when an approximating straight line approachessufficiently a real boundary, a change in inclination angles of theapproximating straight line segments of two adjacent segments is verysmall. That is, the difference between inclination angles ofapproximating straight line segments of two adjacent segments will besmaller than the predetermined threshold Th2. In some embodiment, theconcentration degree evaluation unit may not be used, and only theinclination angle evaluation unit 72 is set to evaluate the possibleapproximating straight line segment.

Return back to FIG. 3. When a result of boundary-approximating performedin the boundary estimation unit 301 is input to the interfering gradientprocessing unit 302, the interfering gradient processing unit 302processes gradient near the approximating straight lines in each of thesegments, respectively. For instance, the interfering gradientprocessing unit 302 reduces or removes gradient in a predeterminedregion except for the narrow band covering the approximating straightline segment, as shown by the former two segments counted from the leftin FIG. 8.

FIG. 8 is an explanatory view illustratively showing an example of afirst case of interfering gradient processing according to an embodimentof the invention. Take a document image as an example, in case thatapproximating straight line segments of two segments have been obtainedsuccessfully starting from the outermost corner, the interferinggradient processing unit 302 may perform an interfering gradient processon the two segments. The specific processing method may be thefollowing: for each of the segments, processing gradient in apredetermined region (such as the rectangular region near the boundaryshown in FIG. 8) except for the narrow band covering the approximatingstraight line segment. The processed portion is shown by the hatchingportion. The predetermined region on which the gradient process isperformed may be set on the basis of a characteristic of an object imageand a distribution characteristic of an interfering content. Thespecific examples of processing have been described above.

FIGS. 9 and 10 are explanatory views showing illustratively the examplesof the second and third cases of interfering gradient process accordingto an embodiment of the invention, respectively.

As shown in FIG. 9, when for example the evaluation unit 702 determinesthe approximating straight line segment of the outmost segment isunavailable, the interfering gradient processing unit 302 (700)processes gradient except for the narrow band covering a predeterminedwidth above and under the horizontal line where the corner locates.Moreover, the boundary tracing unit 303 traces a boundary of an objectimage for the image subjected to the process. Although FIG. 9 shows onlya case of approximating from a corner at one end, it may be understoodthat the processing method shown in FIG. 9 is also applicable for thecase of approximating simultaneously from corners at both ends.

In addition, when approximating is only started from a corner at oneend, until an approximating straight line segment of a certain segmentis unavailable, the interfering gradient processing unit 302 may connectan end point of an approximating straight line segment of the lastsegment for which the approximating is available to a corner at theother end, and to process the gradient of the connecting line at theside where the boundary does not exist.

In the embodiment as shown in FIG. 10, approximating has been performedsuccessfully for the boundary for the former four segments starting fromthe corner A. At this time, gradient in a predetermined region exceptfor the narrow band covering the approximating straight line segment maybe processed in the interfering gradient processing manner shown in FIG.8 for each of the four segments starting from the corner A in FIG. 10.In addition, since the boundary-approximating straight line of the fifthsegment is not obtained successfully, the interfering gradientprocessing unit 302 may connect an end point C of an approximatingstraight line segment of the last (the fourth) segment for which theapproximating is available to a corner B at the other end, and toprocess the gradient of the connecting line at the side where theboundary does not exist.

For a document image, considering the fact that distortion occurs badlyto the boundary at the side near the document banding line, thepre-process of locating a boundary of the boundary near the banding lineand reducing or removing the interfering gradient near the location maynot be performed, and in the same manner as shown in FIG. 10, the endpoint (C) of the obtained approximating straight line segment nearest tothe document banding line is connected to the corner (B) on the bandingline, and the gradient of the connecting line of the C, B at the sidewhere the boundary does not exist is processed. Examples will be givenfor such an embodiment in detail later.

In addition, in another embodiment, when approximating is startedsimultaneously from corners at both ends, and an approximation of asegment at a certain side or at both sides is unavailable, theinterfering gradient processing unit connects an end point of anapproximating straight line segment of the last segment for which theapproximating is available to an end point of an approximating straightline segment of the last segment for which the approximating isavailable at the other side, and to process the gradient of theconnecting line at the side where the boundary does not exist. In caseof a complex boundary curve, a boundary may exist at both sides of theconnecting line of C, B. In such a case, the interfering gradientprocesses performed for segments 5, 6 referring to FIG. 10 are notperformed.

The above embodiments are all described by referring to the documentscanning image shown in FIG. 1. However, after reading through thedisclosure, those skilled in the art shall appreciate that the techniqueinvolved in the disclosure is not limited to boundary tracing of adocument image, and may be applied to boundary tracing of other specificobject images, as long as the boundary of the object image iscontinuous, and the rate of change in slope between adjacent points isslow.

The image processing device tracing a boundary of a document image maybe integrated into a scanner to implement subsequent process on thescanned image obtained by the scanner.

FIG. 11 is a flowchart showing a processing procedure of the boundarytracing method according to an embodiment of the invention. By using themethod, it is possible to trace a boundary of an object image in animage input from an image obtaining device or reading from a memorydevice, particularly a boundary of an object image where the boundary iscontinuous and the rate of change in slope between adjacent points isslow.

In step S1101, a location of a boundary of an object image is estimated.Take the document image shown in FIG. 1 as an example, locations of theupper and lower boundaries of the document image may be estimated tolocate preliminary a boundary of the document to facilitate to performsubsequent gradient reducing or removing operation. The location of theboundary of the document may be estimated by using various methods knownin the art. For example, the preliminary boundary detecting techniquesuch as Sobel operator may be used. A location of a boundary may even bymarked manually on a document image.

In step S1102, an interfering gradient near the estimated boundary isprocessed to reduce or remove an interfering gradient from an image.After the location of the estimated boundary is obtained, theinterfering gradient near the position may be reduced or removedselectively. For example, when the location of the lower boundary of thedocument image in FIG. 1 has been estimated, the gradient of all of thepixels in the adjacent regions above the lower boundary may be reducedor removed. Similarly, when there is other texture on the background ofthe document image, the gradient of all of the pixels in the adjacentregion under the lower boundary may be reduced or removed. The specificexamples of reducing or removing an interfering gradient have beendescribed above.

In step S1108, a boundary of an object image for the image having theinterfering gradient processed is traced. For example, for a documentimage having the interfering gradient processed, boundary tracingprocess may be performed by using various boundary tracing technologieswell known in the art such as the dynamic planning.

Since the accuracy of the location of the estimated boundary affectsgreatly the validity of processing an interfering gradient and thusaffects greatly an accuracy of boundary tracing, various known methodsmay be used to improve an accuracy of a location of an estimatedboundary.

In an embodiment, a portion of the image between two corners on theboundary may be segmented into a predetermined number of segments. Then,a location of a boundary is estimated for each of the segmentedsegments.

In case of two given corners, a predetermined number of segments on theboundary may be obtained in a simplest manner: segmenting evenly asegment between two corners using a segmentation line perpendicular to aconnecting line of two corners to segment a boundary curve. For example,as the example shown in FIG. 4, the boundary curve is segmented into 6segments. Of course, any other segmentation manner may be selected onthe basis of a design demand. For instance, a boundary may be segmentedby a segment line inclined to a connecting line of two corners or bysegmenting unevenly a connecting line of corners. The number of thesegment segmented is determined upon a distance between corners at bothends of the boundary, required boundary estimation preciseness, etc. Forexample, 5 to 20 segments may be selected. A compromise is made betweenthe system calculation amount and the boundary estimation preciseness.

A corner of a boundary may be determined in different manners. Forexample, a corner of a boundary may be detected automatically by usingvarious corner detecting methods well known in the art. Or, a corner isdetermined by a manual input.

A location of a boundary may be estimated automatically orinputting-manually using various well known methods for each of thesegmented segments. In an example, the boundary in each of the segmentsmay be approximated using a straight line segment, and usability of anapproximating straight line segment obtained is evaluated to obtain theestimated boundary location. Descriptions will be given specifically byexamples.

At first, boundary-approximating process may be performed from theoutermost segment (that is, the segment where the corner locates) amongall of the segments. According to a characteristic of a boundary of anobject image and a designing requirement, boundary-approximating may beselected to be performed from two outermost segments or from oneoutermost segment. In conjunction with the embodiment shown in FIG. 5,boundary-approximating is only performed from the outermost segment ofthe document where corner A away from the binding line locates,considering distortion occurs badly to a boundary near the documentbinding line.

Specifically, the corner A in the outermost segment may be set as astart point of a straight line segment used to approximate the boundaryin the outermost segment, and an end point for theboundary-approximating straight line segment is selected on asegmentation line a1 resulting in the outermost segment, so that in agradient histogram of a narrow band covering the first straight linesegment, pixels exhibit the greatest degree of concentration withrespect to the greatest gradient. As to “pixels exhibit the greatestdegree of concentration with respect to the greatest gradient”,descriptions have been given above by examples by referring to formulae(1) and (2), and detailed descriptions are omitted here.

When an end point of a boundary-approximating straight line segment on asegment line a1 in the outermost segment has been obtained, the obtainedend point may be set as a start point of a straight line segment used toapproximate the boundary in a next, adjacent segment. Then, an end pointfor the straight line segment used to approximate may be selected on asegmentation line (a2) which results in the next segment and is notcommon to the next segment and the segment for which theboundary-approximating straight line segment has been obtained, so thatin a gradient histogram of a narrow band covering the second straightline segment, pixels exhibit the greatest degree of concentration withrespect to the greatest gradient. By analogy, approximating straightline segments of all of the segments of boundaries between two cornersare finally obtained.

In case of less demanding on the accuracy of boundary estimating,interfering gradient reducing or removing process may be performeddirectly after an approximating straight line segment of the boundary ofthe segment is obtained, without performing any evaluation orvalidation.

However, to improve accuracy of boundary estimating, the usability ofthe obtained approximating straight line segment may be evaluated.Evaluating usability of the approximating straight line segment, thatis, is to determine whether the approximating straight line segmentapproaches sufficiently a real boundary, or, to determine whether thepossibility that the approximating straight line segment approachessufficiently a real boundary is high enough. Evaluation may be performedby using various determination means and standards well known in theart. For example, an evaluation may be made by using a relation betweena degree at which the pixels concentrate on the greatest gradient andthe predetermined degree as a standard. Or, for example, an evaluationis made by using a difference between inclination angles of the obtainedpossible approximating straight line segment and the approximatingstraight line segment of the previous segment as a standard. When it isdetermined that the approximating straight line segment is available,the approximating straight line segment may be used as an estimatedlocation of the boundary, to process an interfering gradient near thelocation in the image. When it is determined that the approximatingstraight line segment is unavailable, whether to process gradient nearthe approximating straight line segment may be selected according toactual requirements. Descriptions will be given later by examples.

In an embodiment, evaluation may be made based on whether the gradientnear the location where the approximating straight line segment of theboundary locates is black enough. For example, whether a degree at whichthe pixels concentrate on the greatest gradient is larger than or equalto a predetermined degree in a gradient histogram of the narrow bandcovering the approximating straight line segment may be determined. Whenthe concentration degree is larger than or equal to a predetermineddegree, it is determined that the approximating straight line segment ofthe boundary is available; and when the concentration degree is smallerthan a predetermined degree, it is determined that the approximatingstraight line segment of the boundary is unavailable. In case of usingan inverse gradient map, whether a degree at which the pixelsconcentrate on the greatest gradient is larger than or equal to apredetermined degree may be evaluated by using for example a gradient kof α fractile described in conjunction with formula 1. For example, inan embodiment, when k is smaller than or equal to the threshold Th1, itmay be deemed that a degree at which the pixels concentrate on thegreatest gradient is larger than or equal to the predetermined degree;when k is larger than the threshold Th1, it may be deemed that a degreeat which the pixels concentrate on the greatest gradient is smaller thanthe predetermined degree. The value of the threshold Th1 may be a valuesmaller than or equal to 245, preferably between 128 and 255.

When the approximating straight line segment of the boundary isdetermined to be available, alternatively, usability of theapproximating straight line segment may be further validated. Forinstance, an inclination angle of a newly-obtained approximatingstraight line segment may be compared with an inclination angle of anapproximating straight line segment in a previous, adjacent segment.When the difference between the inclination angles is smaller than orequal to a predetermined threshold Th2, it is determined that theapproximating straight line segment is available; when the differencebetween the inclination angles is larger than the predeterminedthreshold Th2, it is determined that the approximating straight linesegment is not available. According to specific conditions, Th2 may be avalue between 0 degree and 90 degrees, for example, Th2 may be 8degrees.

As shown in FIG. 6, when it is given that the boundary is continuous anda rate of change in slope between adjacent points is slow, when theapproximating straight line segment approaches sufficiently a realboundary, the change in inclination angles of the approximating straightline segments of two adjacent segments is very small. That is, thedifference between inclination angles of approximating straight linesegments of two adjacent segments will be smaller than the predeterminedthreshold Th2.

Next, an interfering gradient process is performed on the basis of theresult of the boundary approximating for processing gradient near theapproximating straight line segments in each of the segments. Forexample, reduce or remove all of the gradients in a predetermined regionexcept for the narrow band covering the approximating straight linesegment, as shown in the former two segments counted from the left inFIG. 8.

In one case, take a document image as an example, in case thatapproximating straight line segments of two segments have been obtainedsuccessfully starting from the outermost corner, an interfering gradientprocess may be performed on the two segments. The specific processingmethod may be the following: for each of the segments, reducing orremoving gradient in a predetermined region (as the rectangular regionnear the boundary shown in FIG. 8) except for the narrow band coveringthe approximating straight line segment. The processed portion is shownby the hatching portion. The predetermined region to which the gradientprocess is performed may be set on the basis of a characteristic of anobject image and a distribution characteristic of an interferingcontent.

In another case, when for example it is determined that theapproximating straight line segment of the outmost segment isunavailable, gradient except for the narrow band covering apredetermined width above and under the horizontal line where the cornerlocates may be reduced or removed, and a boundary of an object image ofthe image having the gradient reduced or removed is traced. As shown inFIG. 9, although FIG. 9 shows only a case of approximating from a cornerat one end, it may be understood that the processing method shown inFIG. 9 is also applicable for the case of approximating simultaneouslyfrom corners at both ends.

In addition, when approximating is only started from a corner at oneend, until an approximating straight line segment of a certain segmentis unavailable, an end point of an approximating straight line segmentof the last segment for which the approximating is available may beconnected to a corner at the other end, and the gradient of theconnecting line at the side where the boundary does not exist isprocessed.

In yet another case, boundary-approximating has been performedsuccessfully for the former four segments starting from the corner A. Atthis time, gradient in a predetermined region except for the narrow bandcovering the approximating straight line segment may be reduced orremoved in the interfering gradient processing manner shown in FIG. 8for each of the four segments starting from the corner A in FIG. 10. Inaddition, since the boundary-approximating straight line segment of thefifth segment is not obtained successfully, an end point C of anapproximating straight line segment of the last segment (the fourthsegment) for which the approximating is available may be connected to acorner B at the other end, and the gradient of the connecting line atthe side where the boundary does not exist is processed.

For a document image, considering the fact that distortion occurs badlyto the boundary at the side near the document banding line, thepre-process of locating a boundary of the boundary near the banding lineand reducing or removing the interfering gradient near the location maynot be performed, and in the same manner as shown in FIG. 10, the endpoint (C) of the obtained approximating straight line segment nearest tothe document banding line is connected to the corner (B) on the bandingline, and the gradient of the connecting line of the C, B where theboundary does not exist is processed.

In addition, in another embodiment, when approximating is startedsimultaneously from corners at both ends, and an approximation of asegment at a certain side or at both sides is unavailable, theinterfering gradient processing unit connects an end point of anapproximating straight line segment of the last segment for which theapproximating is available to an end point of an approximating straightline segment of the last segment for which the approximating isavailable at the other side, and to process the gradient of theconnecting line at the side where the boundary does not exist.

A specific application of the invention is described by referring toFIG. 12. FIG. 12 is a flow chart illustratively showing a documentboundary tracing process performed on the document image shown in FIG.1.

In an embodiment, boundary tracing may be performed for upper and lowerboundaries at the left side and the right side of the document bindingline. The lower boundary at the left side of the document binding lineis taken an example.

In step S1201, two end points of the lower boundary curve are obtained.A corner may be extracted automatically or a location of the corner maybe input manually.

In step S1202, in any manner, for example, a number of segmenting linesperpendicular to the connecting line of two end points may be used tosegment the boundary curve into N segments; and a value is assigned tothe variable n (n=0 . . . N) to make n=1.

In step S1203, whether n is smaller than or equal to N−2 is determined.When it is determined in step S1203 that n is smaller than or equal toN−2, in step S1204, a straight line segment is used to approximate aboundary in the nth segment to obtain an approximating straight linesegment of the boundary.

Next, the most possible approximating straight line segment obtainedfinally is evaluated. In step S1205, determine whether the gradient ofthe location where the obtained approximating straight line segmentlocates is intense enough. When it is determined in step S1205 that thegradient of the location where the obtained approximating straight linesegment locates is intense enough, in step S1206, whether n is equal to1 is determined. If n=1, proceed to step S1208, for example, as thedescription given by referring to FIG. 8, gradient except for the narrowband covering the approximating straight line segment (for the sake ofconciseness, it is referred to as “process gradient 1” hereinafter) isreduced or removed.

If it is determined in step S1206 that n is not equal to 1, the processproceeds to step S1207 to determine whether the difference between theinclination angle of the approximating straight line segment of the nthsegment and the inclination angle of the straight line segment of the(n−1)th segment that has been approximated successfully is smallerenough. If it is smaller enough, the process proceeds to step S1208 toprocess gradient 1. Then, the process proceeds to step S1209 to make nincrease by 1. Then the process returns back to step S1203 to determinewhether n is smaller than or equal to N−2.

When No is determined in step S1205, that is, the gradient of thelocation where the obtained approximating straight line segment locatesis not intense enough, that is, the approximating straight line segmentis unavailable, the process proceeds to step S1210 to determine whethern is equal to 1. If n=1, the process proceeds to step S1211, as thedescription given by referring to FIG. 9, to process a gradient exceptfor the narrow band covering a predetermined width above and under thehorizontal line where the end point locates (for the sake ofconciseness, it is referred to as “process gradient 2” hereinafter).Then, the process proceeds to step S1212 to stop a pre-process ofestimating a boundary and processing the interfering gradient, and totrace a boundary of the document image having the interfering gradientprocessed.

When n is not equal to 1, the pre-process of estimating a boundary andprocessing an interfering gradient is stopped, and step S1212 isperformed directly to start tracing a boundary of the document image.

In addition, when it is determined in step S1207 that the differencebetween the inclination angles is relatively large, the pre-process ofestimating a boundary and processing an interfering gradient is stopped,and step S1212 is performed directly to start tracing a boundary of thedocument image.

Considering that distortion occurs badly to the document boundary nearthe binding line, when it is found in the determination step in S1203that n is equal to N−2, the process proceeds to step S1213. In stepS1213, as the description given by referring to FIG. 10, an end point ofthe approximating straight line segment obtained in the (N−2)th segmentis connected to an end point of the boundary located on the bindingline, and the content gradient in the region above the connecting line(for the sake of conciseness, it is called as “process gradient 3”hereinafter) is processed.

Then, the process proceeds to step S1212 to stop the pre-process ofestimating a boundary and processing an interfering gradient, and tostart tracing a boundary of the document image.

Here, it is noted that in some embodiments, step S1206 may be omitted.An pre-estimated inclination angle may be used to compare theinclination angles when evaluating the approximating straight linesegment of the first segment.

Hereinafter, referring to FIG. 13, the example structure of a computerimplementing the data processing device of the invention will bedescribed. FIG. 13 is a block diagram showing an example structure ofthe computer implementing the invention.

In FIG. 13, a central processing unit (CPU) 1301 performs variousprocesses according to the program stored in the Read-Only Memory (ROM)1302 or programs loaded from the storage section 1308 to the RandomAccess Memory (RAM) 1303. In the RAM 1303, data required when the CPU1301 performs various processes is also stored as required.

CPU 1301, ROM 1302 and RAM 1303 are connected from one to another viabus 1304. Input/output interface 1305 is also connected to the bus 1304.

The following components are connected to the input/output interface1305: input section 1306 (including keyboard, mouse, etc.); outputsection 1307 (including display, such as cathode ray tube (CRT), liquidcrystal display (LCD), etc., and speakers and so on); storage section1308 (including hard disc, etc.); and communication part 1309 (includingnetwork interface cards such as LAN cards, modems and so on). Thecommunication section 1309 performs communication processes via networklike the internet.

According to requirements, drive 1310 is also connected to theinput/output interface 1305. Detachable medium 1311 such as magnetodisk, optical disk, magneto-optical disk, semiconductor memory, and soon may be installed on the drive 1310 based on requirements, such thatthe computer program read out therefrom is installed in the storagesection 1308 based on requirements.

In case of implementing the above steps and processes by software,programs constituting the software are installed from a network like theInternet or from a storage medium like the detachable medium 1311.

Those skilled in the art should understand that such storage medium isnot limited to the detachable medium 1311 which is stored with programsand distributed separately from the method to provide a user withprogram as shown in FIG. 13. The example of the detachable medium 1311includes magneto disk, optical disk (including CD read only memory(CD-ROM) and digital versatile disc (DVD)), magneto-optical disk(including mini-disk (MD)) and semiconductor memory. Alternatively, thestorage medium may be ROM 1302, or hard disk included in the storagesection 1308 in which a program is stored and the program is distributedto a user with the method including the same.

In the description of the specific embodiments of the invention,features descried and/or shown in one embodiment may be used in one ormore other embodiments in a same or similar manner, or may be combinedwith features in other embodiments, or may replace features in otherembodiments.

It shall be emphasized that the technical term “comprise/include” isused here to refer to an existence of a feature, an element, a step or acomponent, without excluding existences or addition of one or more otherfeatures, elements, steps or components. Terms “first”, “second”relating to the ordinal number do not indicate the execution order orthe degree of importance of the features, the elements, the steps or thecomponents defined by those terms, and are configured to identify amongthe features, the elements, the steps or the components for the sake ofclearness.

In addition, the method of various embodiments of the invention is notlimited to be executed by the temporal order provided in the Descriptionand shown in the drawings, and the method may be executed sequentiallyby other time order, in parallel or independently. Therefore, the orderof executing the method described in the Description does not limit thescope of protection of the invention.

In conclusion, according to embodiments of the invention, the inventionprovides the following solutions:

1. An image processing device for tracing a boundary of an object imagein an image, the boundary being continuous and the rate of change inslope between adjacent points on the boundary being slow, the imageprocessing device comprising:

a boundary estimation unit, adapted to estimate the location of theboundary of the object image;

an interfering gradient processing unit, adapted to process aninterfering gradient near the estimated boundary, so as to reduce theinterfering gradient or remove the interfering gradient from the image;and

a boundary tracing unit, adapted to trace the boundary in the imagehaving the interfering gradient processed.

2. The image processing device according to Appendix 1, wherein theboundary estimation unit comprises:

a segmentation unit, adapted to segment a portion of the image betweentwo corners on the boundary into a predetermined number of segments; and

a segment boundary estimation unit, adapted to estimate the location ofthe boundary respectively in each of the segments.

3. The image processing device according to Appendix 2, wherein thesegment boundary estimation unit comprises a boundary approximation unitfor approximating the boundary in each of the segments using a straightline segment,

wherein the boundary approximation unit is adapted to, for at least oneof outermost segments where the corners are in respectively, set thecorner in the outermost segment as a start point of a first straightline segment used to approximate the boundary in the outermost segment,and select an end point for the first straight line segment on a firstsegmentation line resulting in the outermost segment, so that in agradient histogram of a narrow band covering the first straight linesegment, pixels exhibit the greatest degree of concentration withrespect to the greatest gradient; and

the boundary approximation unit is further adapted to set the obtainedend point of the boundary-approximating straight line segment as a startpoint of a second straight line segment used to approximate the boundaryin a next, adjacent segment, and select an end point for the secondstraight line segment on a second segmentation line which results in thenext segment and is not common to the next segment and the segment forwhich the boundary-approximating straight line segment has beenobtained, so that in a gradient histogram of a narrow band covering thesecond straight line segment, pixels exhibit the greatest degree ofconcentration with respect to the greatest gradient.

4. The image processing device according to Appendix 3, wherein thesegment boundary estimation unit further comprises an evaluation unitadapted to evaluate usability of an approximating straight line segmentobtained by the boundary approximation unit.

5. The image processing device according to Appendix 4, wherein theevaluation unit comprises: a concentration degree evaluation unit,adapted to determine whether a degree at which the pixels concentrate onthe greatest gradient is larger than or equal to a predetermined degree,and if it is larger than or equal to the predetermined degree, theconcentration degree evaluation unit determines that the approximatingstraight line segment of the boundary is available; otherwise, theconcentration degree evaluation unit determines the approximatingstraight line segment of the boundary is unavailable.

6. The image processing device according to Appendix 4 or 5, wherein theevaluation unit comprises: an inclination angle evaluation unit, adaptedto compare an inclination angle of a newly-obtained approximatingstraight line segment with an inclination angle of an approximatingstraight line segment in a previous, adjacent segment, and if thedifference between the inclination angles is smaller than or equal to apredetermined threshold, the inclination angle evaluation unitdetermines the approximating straight line segment is available;otherwise, the inclination angle evaluation unit determines theapproximating straight line segment is not available.

7. The image processing device according to any one of Appendixes 3-6,wherein the interfering gradient processing unit is adapted to processan interfering gradient near the approximating straight line segment foreach of the segments.

8. The image processing device according to Appendix 7, wherein, theinterfering gradient processing unit processes gradient in apredetermined region except for a narrow band covering the approximatingstraight line segment.

9. The image processing device according to any one of Appendixes 4 to6, wherein, when an approximating straight line segment in the outermostsegment is unavailable, the interfering gradient processing unit isadapted to process gradients except for the narrow band covering apredetermined width above and under a horizontal line where corners arein; and the boundary tracing unit is adapted to trace a boundary of anobject image of the image subjected to the process.

10. The image processing device according to any one of Appendixes 4 to6, wherein, when approximating is only started from a corner at one end,and an approximating straight line segment of a certain segment isunavailable, the interfering gradient processing unit is adapted toconnect an end point of an approximating straight line segment of thelast segment for which the approximating is available to a corner at theother end, and to process the gradient of the connecting line at theside where the boundary does not exist.

11. The image processing device according to any one of Appendixes 4 to6, wherein, when approximating is started simultaneously from corners atboth ends, and an approximation of a segment at a certain side or atboth sides is unavailable, the interfering gradient processing unit isadapted to connect an end point of an approximating straight linesegment of the last segment for which the approximating is available toan end point of an approximating straight line segment of the lastsegment for which the approximating is available at the other side, andto process the gradient of the connecting line at the side where theboundary does not exist.

12. The image processing device according to any one of Appendixes 1 to11, wherein the object image is a document image.

13. A scanner, comprising the image processing device according to anyone of Appendixes 1-12.

14. An image processing method of tracing a boundary of an object imagein an image, the boundary being continuous and the rate of change inslope between adjacent points on the boundary being slow, the imageprocessing method comprises:

-   -   a boundary estimation step, of estimating the location of the        boundary of the object image;    -   an interfering gradient processing step, of processing an        interfering gradient near the estimated boundary, so as to        reduce the interfering gradient or remove the interfering        gradient from the image; and    -   a boundary tracing step, of tracing the boundary in the image        having the interfering gradient processed.

15. The image processing method according to Appendix 14, wherein, theboundary estimation step comprises:

a segmentation step of segmenting a portion of the image between twocorners on the boundary into a predetermined number of segments;

a segment boundary estimation step of estimating the location of theboundary respectively in each of the segments.

16. The image processing method according to Appendix 15, wherein thesegment boundary estimation step comprises a boundary approximating stepof approximating the boundary in each of the segments using a straightline segment, the boundary approximating step comprising:

for at least one of outermost segments where the corners are inrespectively, setting the corner in the outermost segment as a startpoint of a first straight line segment used to approximate the boundaryin the outermost segment, and selecting an end point for the firststraight line segment on a first segmentation line resulting in theoutermost segment, so that in a gradient histogram of a narrow bandcovering the first straight line segment, pixels exhibit the greatestdegree of concentration with respect to the greatest gradient; and

setting the obtained end point of the boundary-approximating straightline segment as a start point of a second straight line segment used toapproximate the boundary in a next, adjacent segment, and selecting anend point for the second straight line segment on a second segmentationline which results in the next segment and is not common to the nextsegment and the segment for which the boundary-approximating straightline segment has been obtained, so that in a gradient histogram of anarrow band covering the second straight line segment, pixels exhibitthe greatest degree of concentration with respect to the greatestgradient.

17. The image processing method according to Appendix 16, wherein thesegment boundary estimation step further comprises an evaluation step ofevaluating usability of the obtained approximating straight linesegment.

18. The image processing method according to Appendix 17, wherein theevaluation step comprises: determining whether a degree at which thepixels concentrate on the greatest gradient is larger than or equal to apredetermined degree, and if it is larger than or equal to thepredetermined degree, determining that the approximating straight linesegment of the boundary is available; if it is smaller than thepredetermined degree, determining that the approximating straight linesegment of the boundary is unavailable.

19. The image processing method according to Appendix 17 or 18, wherein,the evaluation step comprises: comparing an inclination angle of anewly-obtained approximating straight line segment with an inclinationangle of an approximating straight line segment in a previous, adjacentsegment, and if the difference between the inclination angles is smallerthan or equal to a predetermined threshold, determining theapproximating straight line segment is available; if the differencebetween the inclination angles is larger than a predetermined threshold,determining the approximating straight line segment is unavailable.

20. The image processing method according to any of Appendixes 16 to 19,wherein, interfering gradients near the approximating straight linesegments in each of the segments are processed respectively in theinterfering gradient processing step.

21. The image processing method according to Appendix 20, wherein,gradient in a predetermined region except for the narrow band coveringthe approximating straight line segment is processed in the interferinggradient processing step.

22. The image processing method according to any of Appendixes 17 to 19,wherein, when an approximating straight line segment in the outermostsegment is unavailable, in the interfering gradient processing step,gradients except for the narrow band covering a predetermined widthabove and under a horizontal line where corners are in are processed;and in the boundary tracing step, a boundary of an object image of theimage subjected to the process is traced.

23. The image processing method according to any of Appendixes 17 to 19,wherein, when approximating is only started from a corner at one end,and an approximating straight line segment of a certain segment isunavailable, in the interfering gradient processing step, an end pointof an approximating straight line segment of the last segment for whichthe approximating is available is connected to a corner at the otherend, and the gradient of the connecting line at the side where theboundary does not exist is processed.

24. The image processing method according to any of Appendixes 17 to 19,wherein, when approximating is started simultaneously from corners atboth ends, and an approximation of a segment at a certain side or atboth sides is unavailable, in the interfering gradient processing step,an end point of an approximating straight line segment of the lastsegment for which the approximating is available is connected to an endpoint of an approximating straight line segment of the last segment forwhich the approximating is available at the other side, and the gradientof the connecting line at the side where the boundary does not exist isprocessed.

25. The image processing method according to any of Appendixes 14 to 24,wherein the object image is a document image.

26. A computer-readable storage medium, having a computer program storedthereon when executed instructing a computer to perform a process fortracing a boundary of an object image in an image, the boundary beingcontinuous and the rate of change in slope between adjacent points onthe boundary is slow, wherein the process comprises:

-   -   estimating the location of the boundary of the object image;    -   processing an interfering gradient near the estimated boundary,        so as to reduce the interfering gradient or remove the        interfering gradient from the image; and    -   tracing the boundary in the image having the interfering        gradient processed.

1. An image processing device for tracing a boundary of an object imagein an image, the boundary being continuous and the rate of change inslope between adjacent points on the boundary being slow, the imageprocessing device comprising: a boundary estimation unit, adapted toestimate the location of the boundary of the object image; aninterfering gradient processing unit, adapted to process an interferinggradient near the estimated boundary, so as to reduce the interferinggradient or remove the interfering gradient from the image; and aboundary tracing unit, adapted to trace the boundary in the image havingthe interfering gradient processed.
 2. The image processing deviceaccording to claim 1, wherein the boundary estimation unit comprises: asegmentation unit, adapted to segment a portion of the image between twocorners on the boundary into a predetermined number of segments; and asegment boundary estimation unit, adapted to estimate the location ofthe boundary respectively in each of the segments.
 3. The imageprocessing device according to claim 2, wherein the segment boundaryestimation unit comprises a boundary approximation unit forapproximating the boundary in each of the segments using a straight linesegment, wherein the boundary approximation unit is adapted to, for atleast one of outermost segments where the corners are in respectively,set the corner in the outermost segment as a start point of a firststraight line segment used to approximate the boundary in the outermostsegment, and select an end point for the first straight line segment ona first segmentation line resulting in the outermost segment, so that ina gradient histogram of a narrow band covering the first straight linesegment, pixels exhibit the greatest degree of concentration withrespect to the greatest gradient; and the boundary approximation unit isfurther adapted to set the obtained end point of theboundary-approximating straight line segment as a start point of asecond straight line segment used to approximate the boundary in a next,adjacent segment, and select an end point for the second straight linesegment on a second segmentation line which results in the next segmentand is not common to the next segment and the segment for which theboundary-approximating straight line segment has been obtained, so thatin a gradient histogram of a narrow band covering the second straightline segment, pixels exhibit the greatest degree of concentration withrespect to the greatest gradient.
 4. The image processing deviceaccording to claim 3, wherein the segment boundary estimation unitfurther comprises an evaluation unit adapted to evaluate usability of anapproximating straight line segment obtained by the boundaryapproximation unit.
 5. The image processing device according to claim 4,wherein the evaluation unit comprises: a concentration degree evaluationunit, adapted to determine whether a degree at which the pixelsconcentrate on the greatest gradient is larger than or equal to apredetermined degree, and if it is larger than or equal to thepredetermined degree, the concentration degree evaluation unitdetermines that the approximating straight line segment of the boundaryis available; otherwise, the concentration degree evaluation unitdetermines the approximating straight line segment of the boundary isunavailable.
 6. The image processing device according to claim 4,wherein the evaluation unit comprises: an inclination angle evaluationunit, adapted to compare an inclination angle of a newly-obtainedapproximating straight line segment with an inclination angle of anapproximating straight line segment in a previous, adjacent segment, andif the difference between the inclination angles is smaller than orequal to a predetermined threshold, the inclination angle evaluationunit determines the approximating straight line segment is available;otherwise, the inclination angle evaluation unit determines theapproximating straight line segment is not available.
 7. The imageprocessing device according to claim 3, wherein the interfering gradientprocessing unit is adapted to process an interfering gradient near theapproximating straight line segment for each of the segments.
 8. Theimage processing device according to claim 7, wherein, the interferinggradient processing unit processes gradient in a predetermined regionexcept for a narrow band covering the approximating straight linesegment.
 9. The image processing device according to claim 4, wherein,when an approximating straight line segment in the outermost segment isunavailable, the interfering gradient processing unit is adapted toprocess gradients except for the narrow band covering a predeterminedwidth above and under a horizontal line where corners are in; and theboundary tracing unit is adapted to trace a boundary of an object imageof the image subjected to the process.
 10. The image processing deviceaccording to claim 4, wherein, when approximating is only started from acorner at one end, and an approximating straight line segment of acertain segment is unavailable, the interfering gradient processing unitis adapted to connect an end point of an approximating straight linesegment of the last segment for which the approximating is available toa corner at the other end, and to process the gradient of the connectingline at the side where the boundary does not exist.
 11. The imageprocessing device according to claim 4, wherein, when approximating isstarted simultaneously from corners at both ends, and an approximationof a segment at a certain side or at both sides is unavailable, theinterfering gradient processing unit is adapted to connect an end pointof an approximating straight line segment of the last segment for whichthe approximating is available to an end point of an approximatingstraight line segment of the last segment for which the approximating isavailable at the other side, and to process the gradient of theconnecting line at the side where the boundary does not exist.
 12. Theimage processing device according to claim 1, wherein the object imageis a document image.
 13. A scanner, comprising the image processingdevice according to claim
 1. 14. An image processing method of tracing aboundary of an object image in an image, the boundary being continuousand the rate of change in slope between adjacent points on the boundarybeing slow, the image processing method comprises: a boundary estimationstep, of estimating the location of the boundary of the object image; aninterfering gradient processing step, of processing an interferinggradient near the estimated boundary, so as to reduce the interferinggradient or remove the interfering gradient from the image; and aboundary tracing step, of tracing the boundary in the image having theinterfering gradient processed.
 15. The image processing methodaccording to claim 14, wherein, the boundary estimation step comprises:a segmentation step of segmenting a portion of the image between twocorners on the boundary into a predetermined number of segments; asegment boundary estimation step of estimating the location of theboundary respectively in each of the segments.
 16. The image processingmethod according to claim 15, wherein the segment boundary estimationstep comprises a boundary approximating step of approximating theboundary in each of the segments using a straight line segment, theboundary approximating step comprising: for at least one of outermostsegments where the corners are in respectively, setting the corner inthe outermost segment as a start point of a first straight line segmentused to approximate the boundary in the outermost segment, and selectingan end point for the first straight line segment on a first segmentationline resulting in the outermost segment, so that in a gradient histogramof a narrow band covering the first straight line segment, pixelsexhibit the greatest degree of concentration with respect to thegreatest gradient; and setting the obtained end point of theboundary-approximating straight line segment as a start point of asecond straight line segment used to approximate the boundary in a next,adjacent segment, and selecting an end point for the second straightline segment on a second segmentation line which results in the nextsegment and is not common to the next segment and the segment for whichthe boundary-approximating straight line segment has been obtained, sothat in a gradient histogram of a narrow band covering the secondstraight line segment, pixels exhibit the greatest degree ofconcentration with respect to the greatest gradient.
 17. The imageprocessing method according to claim 16, wherein the segment boundaryestimation step further comprises an evaluation step of evaluatingusability of the obtained approximating straight line segment.
 18. Theimage processing method according to claim 17, wherein the evaluationstep comprises: determining whether a degree at which the pixelsconcentrate on the greatest gradient is larger than or equal to apredetermined degree, and if it is larger than or equal to thepredetermined degree, determining that the approximating straight linesegment of the boundary is available; if it is smaller than thepredetermined degree, determining that the approximating straight linesegment of the boundary is unavailable.
 19. The image processing methodaccording to claim 17, wherein, the evaluation step comprises: comparingan inclination angle of a newly-obtained approximating straight linesegment with an inclination angle of an approximating straight linesegment in a previous, adjacent segment, and if the difference betweenthe inclination angles is smaller than or equal to a predeterminedthreshold, determining the approximating straight line segment isavailable; if the difference between the inclination angles is largerthan a predetermined threshold, determining the approximating straightline segment is unavailable.
 20. The image processing method accordingto claim 16, wherein, interfering gradients near the approximatingstraight line segments in each of the segments are processedrespectively in the interfering gradient processing step.